import { defineStore } from 'pinia'

export const userStore = defineStore('userStore', {
  actions: {
    changeuserName(newName: string) {
      if (newName && newName.length > 0) {
        this.userName += newName
      }
    },
  },
  getters: {
    getUserName(): string {
      return this.userName.toUpperCase()
    },
  },
  state: () => ({
    userName: 'feixiang',
    userAge: 25,
  }),
})
